﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using FIFP.DashBoard.Helper;
using System.ComponentModel;

namespace FIFP.DashBoard.Model
{
    public class SettingsData : INotifyPropertyChanged
    {
        public string FieldName { get; set; }
        public int FieldID { get; set; }
        private double iPR = Convert.ToDouble(FIFPConstants.DEFAULT_IPR_VALUE);
        public double IPR
        {
            get { return iPR; }
            set { iPR = value; }
        }
        public double NewIPR { get; set; }

        private double currentMaxProd = -1;
        public double CurrentMaxProd
        {
            get { return currentMaxProd; }
            set { currentMaxProd = value; }
        }

        public double NewMaxProd { get; set; }

        private double currentUnplannedLossesPercentage;
        public double CurrentUnplannedLossesPercentage
        {
            get { return currentUnplannedLossesPercentage; }
            set { currentUnplannedLossesPercentage = value; onPropertyChanged(this, "CurrentUnplannedLossesPercentage"); }
        }

        private double currentMonitoringPercentage;
        public double CurrentMonitoringPercentage
        {
            get { return currentMonitoringPercentage; }
            set { currentMonitoringPercentage = value; onPropertyChanged(this, "CurrentMonitoringPercentage"); }
        }

        public double NewUnplannedLossesPercentage { get; set; }
        public double NewMonitoringPercentage { get; set; }


        // Declare the PropertyChanged event
        public event PropertyChangedEventHandler PropertyChanged;

        // OnPropertyChanged will raise the PropertyChanged event passing the source property that is being updated.
        private void onPropertyChanged(object sender, string propertyName)
        {
            if (this.PropertyChanged != null)
            {
                PropertyChanged(sender, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
